Skip to content

feat: MISRA-C CI, stack usage analysis, hw benchmark configs#1

Merged
tbitcs merged 1 commit into
mainfrom
orchestrator/ci-hw
Jun 2, 2026
Merged

feat: MISRA-C CI, stack usage analysis, hw benchmark configs#1
tbitcs merged 1 commit into
mainfrom
orchestrator/ci-hw

Conversation

@tbitcs

@tbitcs tbitcs commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

MISRA-C CI, Stack Usage Analysis & Hardware Benchmark Configs

Implements REQ-BUILD-003 (MISRA-C analysis CI) and REQ-ARCH-040 (hardware benchmark configurations).

Changes

MISRA-C CI job (.github/workflows/ci.yml)

  • New misra job running cppcheck with MISRA C 2012 addon
  • Falls back to --enable=all built-in checks if the MISRA addon is unavailable
  • Suppresses known intentional deviations (Rules 1.1, 20.9, 21.6)
  • Gates on zero errors (warnings OK)

Stack usage analysis (.github/workflows/ci.yml)

  • Adds -DEXTRA_CFLAGS=-fstack-usage to twister unit test builds
  • Post-build step checks no function exceeds 512-byte stack limit
  • Uploads .su files as separate CI artifact

MISRA deviations doc (docs/safety/MISRA_DEVIATIONS.md)

  • Documents Rules 1.1, 11.3, 14.3, 20.9, 21.6 with rationale and location
  • Defines process for adding new deviations

Hardware benchmark ( ests/benchmarks/hw_benchmark/)

  • Cycle-accurate PID benchmark using DWT CYCCNT on Cortex-M
  • Falls back to clock_gettime on native_sim
  • Board overlays for nucleo_f446re and nucleo_h743zi
  • testcase.yaml with platform_allow for both boards + native_sim
  • README with build/flash/capture instructions

Test Results

  • pytest: 63 passed, 1 skipped (placeholder golden vector)

Conversation: https://app.warp.dev/conversation/0c1afc16-259c-435a-9140-5e87c7d022ec
Run: https://oz.warp.dev/runs/019e88b0-c5e8-7189-b1f6-4660beea2e8d

This PR was generated with Oz.

REQ-BUILD-003: Add cppcheck MISRA C 2012 analysis CI job with fallback
to built-in checks when the MISRA addon is unavailable.

REQ-ARCH-040: Add hardware benchmark configuration for cycle-accurate
PID benchmarking on nucleo_f446re and nucleo_h743zi using DWT CYCCNT.

- Add misra job to CI workflow with suppression for known deviations
- Add -fstack-usage to twister unit tests with 512-byte limit check
- Upload .su files as CI artifacts alongside twister results
- Create docs/safety/MISRA_DEVIATIONS.md documenting Rules 1.1, 11.3,
  14.3, 20.9, 21.6
- Create tests/benchmarks/hw_benchmark/ with DWT CYCCNT timing,
  board overlays, testcase.yaml, and documentation

Co-Authored-By: Oz <oz-agent@warp.dev>
@tbitcs tbitcs merged commit 8612bed into main Jun 2, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant